<template>
	<div class="layout">
		<div id="title">人工认证</div>
		<div>
			<StepBar :step="currentStep" :stepList="stepList"></StepBar>
			<div v-if="type == 0 || type == 1">
        <opInfoComForm v-show="currentStep == 1" v-model="currentStep" shortMessage/>
        <coInfoComForm v-show="currentStep == 2" v-model="currentStep"/>
        <createUserForm v-show="currentStep == 3" v-model="currentStep"/>
        <registerSuccessForm v-show="currentStep == 4" v-model="currentStep"/>
      </div>
      <div v-if="type == 2">
        <infoConfirmForm v-show="currentStep == 1" v-model="currentStep"/>
        <createUserForm v-show="currentStep == 2" v-model="currentStep"/>
        <registerSuccessForm v-show="currentStep == 3" v-model="currentStep"/>
      </div>
      <div v-if="type == 3">
        <opInfoComForm v-show="currentStep == 1" v-model="currentStep"/>
        <createUserForm v-show="currentStep == 2" v-model="currentStep"/>
        <registerSuccessForm v-show="currentStep == 3" v-model="currentStep"/>
      </div>
		</div>
	</div>
</template>

<script>
  import StepBar from './components/stepBar'
  import coInfoComForm from './components/coInfoComForm'
  import createUserForm from './components/createUserForm'
  import infoConfirmForm from './components/infoConfirmForm'
  import opInfoComForm from './components/opInfoComForm'
  import registerSuccessForm from './components/registerSuccessForm'
  export default {
    components: {
      StepBar,
      coInfoComForm,
      createUserForm,
      infoConfirmForm,
      opInfoComForm,
      registerSuccessForm
    },
    data() {
      return {
        stepList: ["经办人信息比对","法人单位信息比对","创建用户","注册成功"],
        currentStep: 1,
        type: 0
      }
    },
    created(){
      this.init()
    },
    activated() {
      this.init()
    },
    methods: {
      init(){
        this.type = this.$route.query.type
        switch(this.type) {
          case "2":
            this.stepList = ["信息确认","创建用户","注册成功"]
            break;
          case "3":
            this.stepList = ["经办人信息比对","创建用户","注册成功"]
            break;
          default:
            break;
        }
      }
    },
  }
</script>

<style lang="scss" scoped>
#title {
  width: 1000px;
  text-align: left;
  margin: 0 auto;
  margin-top: 30px;
  color: #045db9;
  font-size: 20px;
  font-weight: bold;
}

.layout {
  position: relative;
  box-sizing: border-box;
}

.footer {
  position: absolute;
  bottom: 0;
  width: 100%;
}
</style>